package com.icebergteam.warfacewidget.wiki.data;

import android.os.Parcel;
import android.os.Parcelable;
import com.icebergteam.warfacewidget.core.ListViewItem;

public class WikiWidgetItem extends ListViewItem {

	static public final String className = WikiWidgetItem.class.getCanonicalName();
	private String title;
	private String url;
	private String imgSrc;
	

	public WikiWidgetItem() {
		super();
		this.title = "title test";
		this.url = "link test";
		this.imgSrc = "imgSrc test";
	}

	public WikiWidgetItem(Parcel in) {
		super(in);
	
	}
	
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	
	public String getUrl() {
		return url;
	}

	public void setUrl(String _url) {
		this.url = _url;
	}
	
	/**
	 * @return the m_imgSrc
	 */
	public String getImgSrc() {
		return imgSrc;
	}

	/**
	 * @param m_imgSrc the m_imgSrc to set
	 */
	public void setImgSrc(String m_imgSrc) {
		this.imgSrc = m_imgSrc;
	}

	@Override
	public void writeToParcel(Parcel out, int flags) {
		out.writeString(title);
		out.writeString(url);
		out.writeString(imgSrc);
	}

	@Override
	public void readFromParcel(Parcel in) {
		this.title = in.readString();
		this.url = in.readString();
		this.imgSrc = in.readString();
	}

	public static final Parcelable.Creator<WikiWidgetItem> CREATOR = new Parcelable.Creator<WikiWidgetItem>() {
		public WikiWidgetItem createFromParcel(Parcel in) {
			return new WikiWidgetItem(in);
		}

		public WikiWidgetItem[] newArray(int size) {
			return new WikiWidgetItem[size];
		}
	};
	
	@Override
	public String toString() {
		return String.format("%s", String.format("%s = [%s; %s; %s]", className, title, url, imgSrc));
	}

	

}